<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>使用ro</title>
	<link rel="stylesheet" href="../../css/role/role.css">
	<script src="../../js/common.js"></script>
	<script src="../../js/vue.js"></script>
	<script src="../../js/jquery-2.1.1.min.js"></script>
</head>

<body>




	<table class="scott">
		<tr>
			<td colspan="2" style="text-align: center;">
				进入角色页面 [使用roleId去查role]
			</td>
		</tr>

		<tr>
			<td class="left">roleId</td>
			<td>
				<input v-model="roleId" type="text">
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input @click="findRoleById" type="button" value="查询">
			</td>
		</tr>

		<tr>
			<td colspan="2" id="roleData">
				{{roleData}}
			</td>
		</tr>
	</table>


	<script>
		window.onload = function () {

			const vue = new Vue({
				el: '.scott',
				data: {
					'roleId': 20010,
					'roleData': '',
				},
				methods: {

					findRoleById: function () {
						// alert('------');

						let url = getRootPath() + "role/" + this.roleId;


						let callback = function (result) {
							//alert(result);
							console.log(result);
							let code = result.code;
							if (code === 200) {
								var rs = JSON.stringify(result);
								vue.roleData = rs;
								//alert(rs);

							}
						};
						sendGet(url, callback);
					}

				}
			});
		}
	</script>



</body>

</html>